package com.freesky.biz.rights.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.freesky.common.annotation.Desensitized;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 券领取记录
 */
@ContentRowHeight(22)
@ColumnWidth(25)
@HeadRowHeight(25)
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        verticalAlignment = VerticalAlignmentEnum.CENTER,
        borderLeft= BorderStyleEnum.THIN,
        borderRight= BorderStyleEnum.THIN,
        borderTop= BorderStyleEnum.THIN,
        borderBottom= BorderStyleEnum.THIN)//表头样式
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        verticalAlignment = VerticalAlignmentEnum.CENTER,
        borderLeft= BorderStyleEnum.THIN,
        borderRight= BorderStyleEnum.THIN,
        borderTop= BorderStyleEnum.THIN,
        borderBottom= BorderStyleEnum.THIN)
@Data
@TableName("tec_rights_receive")
public class RightsReceiveEntity implements java.io.Serializable{

    @ExcelProperty("记录ID")
    private String id;
    @ExcelProperty("业务编码")
    private String busiId;
    @ExcelProperty("业务名称")
    private String busiName;

    @ExcelIgnore
    @TableField(exist = false)
    private String busiType;

    @ExcelIgnore
    private String activityId;

    @ExcelProperty("权益名称")
    private String activityName;

    @ExcelProperty("手机号码")
    @Desensitized(type = Desensitized.DesensitizedType.PHONE)
    private String mobile;

    @ExcelProperty("领取账号")
    @Desensitized(type = Desensitized.DesensitizedType.PHONE)
    private String receiveAccount;

    @ExcelProperty("客户号")
    private String custId;

    @ExcelProperty("openId")
    private String openId;

    @ExcelProperty("面额(元)")
    private Double amt;

    @ExcelIgnore
    private String userId;
    @ExcelIgnore
    private String channelId;

    @ExcelIgnore
    private String encryptCode;

    @ExcelProperty("券码")
    private String encryptId;

    @ExcelProperty("领取时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ExcelIgnore
    private String delFlag;

    @ExcelProperty("券类型")
    @TableField(exist = false)
    private String couponType;

    @ExcelProperty("领取状态")
    private String sendFlag;

    @ExcelProperty("发放状态")
    @TableField(exist = false)
    private String sendStatus;

    @ExcelProperty("发放状态描述")
    @TableField(exist = false)
    private String reason;

    @ExcelProperty("券号")
    @TableField(exist = false)
    private String stockId;

    @ExcelProperty("有效期")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;


    @ExcelProperty("券ID")
    @TableField(exist = false)
    private String couponId;

    @ExcelProperty("券订单ID")
    @TableField(exist = false)
    private String alipayOrderId;

    @ExcelProperty("核销状态")
    @TableField(exist = false)
    private String usedStatus;


    @ExcelProperty("核销时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date consumeTime;

    @ExcelProperty("补发标志")
    @TableField(exist = false)
    private String reissueFlag;

    /** 请求参数 */
    @ExcelIgnore
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params)
    {
        this.params = params;
    }
}
